package com.bkgy.controller.continuousSlantingHistory.controller;

import com.alibaba.fastjson.JSONObject;
import com.bkgy.controller.continuousSlantingHistory.dto.ContinuousDto;
import com.bkgy.controller.continuousSlantingHistory.service.ContinuousSlantingHistoryService;
import com.bkgy.sys.common.entity.ResultData;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


/**
 * 连退历史跑偏信息
 */
@RestController
@RequestMapping("/continuous")
public class ContinuousSlantingHistoryController {

    @Autowired
    private ContinuousSlantingHistoryService continuousSlantingHistoryService;


    @Operation(summary = "连退历史跑偏均值/标准差", description = "根据时间查询连退历史跑偏均值/标准差")
    @PostMapping("/history")
    public ResultData<Map<String, Object>> getTableData(@RequestBody JSONObject jsonObjec) {
        return continuousSlantingHistoryService.getSteelPositionTableData(jsonObjec);
    }

    @Operation(summary = "连退跑偏历史点图查询", description = "根据条件查询连退跑偏历史点图")
    @PostMapping("/findCpcRoll")
    public ResultData<ContinuousDto> getCpcRoll(@RequestBody JSONObject jsonObjec) {
        return continuousSlantingHistoryService.getCpcRoll(jsonObjec);
    }

}
